package com.wishwall.beans;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * The persistent class for the TD_USER_ROLES database table.
 *
 */
@Entity
@Table(name="TD_USER_ROLES")
public class UserRoleBean implements Serializable {


	private static final long serialVersionUID = 1040802939583465975L;

	@Id
	@Column(name="PK_USER_ROLE_ID", insertable=false, updatable=false)
	private Integer id;

	@Column(name="NAME", insertable=false, updatable=false)
	private String name;

	@Column(name="DISPLAY_NAME", insertable=false, updatable=false)
	private String displayName;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	@Override
	public int hashCode() {
		if (this.id != null) {
			return this.id.hashCode();
		} else {
			return super.hashCode();
		}
	}

	@Override
	public boolean equals(Object obj) {

		if (obj == null) {
			return false;
		}

		if(this == obj) {
			return true;
		}

		if (!(obj instanceof UserRoleBean)) {
			return false;
		}

		if (this == obj) {
			return true;
		}

		UserRoleBean other = (UserRoleBean) obj;
		if ((id == null) || (other.getId() == null)) {
			return false;
		}

		return (id.equals(other.getId()));
	}

}
